home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 24
/
Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso
/
Aminet
/
comm
/
mail
/
Mutt089src.lha
/
Mutt-0.89i-AMIGA
/
src
/
strcasecmp.c
< prev
next >
Wrap
C/C++ Source or Header
|
1998-01-28
|
712b
|
38 lines
#include <ctype.h>
#include <sys/types.h>
/* UnixWare doesn't have these functions in its standard C library */
int strncasecmp (char *s1, char *s2, size_t n)
{
register int c1, c2, l = 0;
while (*s1 && *s2 && l < n)
{
c1 = tolower (*s1);
c2 = tolower (*s2);
if (c1 != c2)
return (c1 - c2);
s1++;
s2++;
l++;
}
return (int) (0);
}
int strcasecmp (char *s1, char *s2)
{
register int c1, c2;
while (*s1 && *s2)
{
c1 = tolower (*s1);
c2 = tolower (*s2);
if (c1 != c2)
return (c1 - c2);
s1++;
s2++;
}
return (int) (*s1 - *s2);
}